import { View } from "../../../mvc/core/View";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { Language } from "../../../../extend/language/Language";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { AdoreOptItem } from "./AdoreOptItem";
type int = number;
//class AdoreOptPanel
    
    export  class AdoreOptPanel extends View
    {
        constructor()
        {
            super();
            this._itemArr = [];
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc5=null;
            ObjCreate.createBg(0, 0, 485, 122, this);
            ObjCreate.createBg(0, 0, 200, 25, this, ImagesConst.TileBg);
            ObjCreate.createGTextField(Language.getString(36355), 5, 2, 450, 20, this, GlobalStyle.textFormat6);
            var loc1=[0, 14141000, 14141000];
            var loc2=[9000003, 9000004, 9000005];
            var loc3=["0", "1-2", "3-4"];
            var loc4=10;
            var loc6=0;
            while (loc6 < 3) 
            {
                (loc5 = new AdoreOptItem()).updateItem(loc6, loc1[loc6], loc2[loc6], loc3[loc6]);
                loc5.x = loc4;
                loc5.y = 30;
                addChild(loc5);
                this._itemArr.push(loc5);
                loc4 = loc4 + 152;
                ++loc6;
            }
            return;
        }

        public guideAdore(arg1: Boolean): void
        {
            var loc1=null;
            var loc2=0;
            while (loc2 < this._itemArr.length) 
            {
                loc1 = this._itemArr[loc2] as AdoreOptItem;
                loc1.guideAdore(arg1);
                ++loc2;
            }
            return;
        }

        public setItemAdoreState(arg1: int): void
        {
            var loc1=null;
            var loc2=0;
            while (loc2 < this._itemArr.length) 
            {
                loc1 = this._itemArr[loc2] as AdoreOptItem;
                loc1.updateItemState(arg1);
                ++loc2;
            }
            return;
        }

        public flyItemBitmap(): void
        {
            var loc1=null;
            var loc2=0;
            while (loc2 < this._itemArr.length) 
            {
                loc1 = this._itemArr[loc2] as AdoreOptItem;
                if (loc1 && loc1.isAdore) 
                {
                    loc1.flyBitmap();
                }
                ++loc2;
            }
            return;
        }

        /* internal */ /* var */_itemArr: Array<any>;
    }
